import { onMounted, onUnmounted } from "vue"

export function useResize(callback) {

    const resize = () => {
        callback()
        console.log('change')
    }

    onMounted(()=> {
        window.addEventListener('resize', resize)
    })
    onUnmounted(()=>{
        window.removeEventListener('resize', resize)
    })
}